package com.gesturesoft.imultimax.views.renderers
{
	import assets.images.hdpi.radio_off_icon;
	import assets.images.hdpi.radio_on_icon;
	
	import com.adobe.crud.model.AutoCompleteOptionModel;
	import com.adobe.crud.model.IAutoCompleteOptionModel;
	
	import spark.components.IconItemRenderer;

	public class MultiSelectListItemRenderer extends IconItemRenderer
	{


		public function MultiSelectListItemRenderer()
		{
			super();

			iconFunction = customIconFunction;
			percentWidth = 100;
		}

		protected function customIconFunction(item:Object):Object
		{
			if (!item)
			{
				return null;
			}

			if (item is AutoCompleteOptionModel)
			{
				if (IAutoCompleteOptionModel(item).selected == true)
				{
					return radio_on_icon;

				}
				else
				{
					return radio_off_icon;
				}
			}

			return null;

		}
	}
}